<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'list.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->


		<script type="text/javascript">
		function del(){
			if(confirm("确定要删除吗?"))
			{return true;}	
			return false;
		}
		</script>

	</head>

	<body>
		<h1>
			<font color=red>Save Users</font>
		</h1>
		<hr />
		<table width="500" border="1px">
			<tr>
				<th>
					序号
				</th>
				<th>
					姓
				</th>
				<th>
					名
				</th>
				<th>
					年龄
				</th>
				<th>
					修改
				</th>
				<th>
					删除
				</th>
			</tr>
			<s:iterator id="us" value="#request.list">
				<tr>
					<td>
						<s:property value="#us.id" />
					</td>
					<td>
						<s:property value="#us.lastname" />
					</td>
					<td>
						<s:property value="#us.firstname" />
					</td>
					<td>
						<s:property value="#us.age" />
					</td>
					<td>
						<s:a href="updatePUser.action?user.id=%{#us.id}">
							<s:property value="%{getText('update')}" />
						</s:a>
					</td>
					<td>
						<s:a href="deleteUser.action?user.id=%{#us.id}" onclick="return del()">
							<s:property value="%{getText('delete')}" />
						</s:a>
					</td>
				</tr>
			</s:iterator>
		</table>
		<s:a href="downloadUser.action">下载</s:a>
	</body>
</html>
